PCI: replace "secondary" flavors of PCI_{DEVFN,BDF,SBDF}()
authorJan Beulich <jbeulich@suse.com>
Thu, 28 Apr 2022 14:14:26 +0000 (16:14 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 28 Apr 2022 14:14:26 +0000 (16:14 +0200)
commit54a71fe63b98c81cae4ff81bd0bd154840c3b44f
treeb465726641c5db23b5c7b250ee2b204f008f4bf9
parentee68339aeee4afa78749b1333c95071196b60c36
PCI: replace "secondary" flavors of PCI_{DEVFN,BDF,SBDF}()

At their use sites the numeric suffixes are at least odd to read, first
and foremost for PCI_DEVFN2() where the suffix doesn't even match the
number of arguments. Make use of count_args() such that a single flavor
each suffices (leaving aside helper macros, which aren't supposed to be
used from the outside).

In parse_ppr_log_entry() take the opportunity and drop two local
variables and convert an assignment to an initializer.

In VT-d code fold a number of bus+devfn comparison pairs into a single
BDF comparison.

No change to generated code for the vast majority of the adjustments.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Paul Durrant <paul@xen.org>
22 files changed:
xen/arch/x86/mm.c
xen/arch/x86/pci.c
xen/arch/x86/x86_64/mmconfig-shared.c
xen/common/compat/memory.c
xen/common/memory.c
xen/drivers/passthrough/amd/iommu_acpi.c
xen/drivers/passthrough/amd/iommu_cmd.c
xen/drivers/passthrough/amd/iommu_detect.c
xen/drivers/passthrough/amd/iommu_init.c
xen/drivers/passthrough/amd/iommu_intr.c
xen/drivers/passthrough/amd/iommu_map.c
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/drivers/passthrough/ats.h
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/dmar.c
xen/drivers/passthrough/vtd/intremap.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/quirks.c
xen/drivers/passthrough/vtd/utils.c
xen/drivers/pci/pci.c
xen/drivers/video/vga.c
xen/include/xen/pci.h